package org.sanguine.tests.tenderpro.actions;

import org.sanguine.tests.tenderpro.XmlWorker;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Author: Alexey Kuznetsov
 * Date: 19.02.14
 * Time: 16:10
 * SVN $Id$
 */
public class CountAttribute extends XmlWorker implements Action {

    @Override
    public void doAction(List<String> params) {
        System.out.println("Attribute " + getElement() + ": " + doCountElement());
    }

    public CountAttribute(List<String> params) throws XMLStreamException, ParserConfigurationException, IOException, SAXException {
        super(params.get(0), params.contains("--schema"), "*[@".concat(params.get(1).trim()).concat("]"));
    }
}
